package com.多线程.ThreadSafe;

/**
 * 定义线程类---> 继承Thread类
 */

public class DrawThread extends Thread {
    //接收处理的账户对象，重写线程名
    private Account acc;
    //自己写构造器
    public DrawThread(Account acc,String name){
        super(name);
        this.acc=acc;
    }

    /**
     * 重写run方法，里面是定义线程以后要干嘛
     */
    @Override
    public void run() {
        //取钱方法应该放在Account类里面
        acc.drawMoney(100000);

    }
}
